Design and evaluation of C++ open multi-methods

نویسندگان

  • Peter Pirkelbauer
  • Yuriy Solodkyy
  • Bjarne Stroustrup
چکیده

Multiple dispatch – the selection of a function to be invoked based on the dynamic type of two or more arguments – is a solution to several classical problems in object-oriented programming. Open multi-methods generalize multiple dispatch towards open-class extensions, which improve separation of concerns and provisions for retroactive design. We present the rationale, design, implementation, performance, programming guidelines, and experiences of working with a language feature, called open multi-methods, for C++. Our openmulti-methods support both repeated and virtual inheritance. Our call resolution rules generalize both virtual function dispatch and overload resolution semantics. After using all information from argument types, these rules can resolve further ambiguities by using covariant return types. Carewas taken to integrate openmulti-methodswith existing C++ language features and rules. We describe a model implementation and compare its performance and space requirements to existing openmulti-method extensions andworkaround techniques for C++. Compared to these techniques, our approach is simpler to use, catches more user mistakes, and resolves more ambiguities through link-time analysis, is comparable in memory usage, and runs significantly faster. In particular, the runtime cost of calling an openmulti-method is constant and less than the cost of a double dispatch (two virtual function calls). Finally, we provide a sketch of a design for open multi-methods in the presence of dynamic loading and linking of libraries. © 2009 Elsevier B.V. All rights reserved.

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

O-8: Clinical Application and Evaluation of Autologous Keratinocyte and Fibroblast Cells Culture on Horse Open Wound Healing

KFGS (Keratinocyte fibrin glue suspension) and FKFGS (Fibroblast keratinocyte fibrin glue suspension) methods were performed in this study. Materials and Methods: Four healthy adult horses were used in this study (350 ± 117). Fibroblast cells have been separated by explant culture method from neck, keratinocyte cells have been separated by enzyme digestion from lib skin samples and Fibrinogen h...

متن کامل

Design of Compact Multi-Channel Diplexer Using Defected Microstrip Structure

In this paper, two compact quad-channel and six-channel diplexer are designed and fabricated using defected microstrip structure (DMS). This structure is designed for the desired frequency based on the literature reviews. The proposed configuration is composed of a conventional T-junction divider with two pairs of open bended stubs and dual/tri-band filters. In designing dual band filters, a lo...

متن کامل

Efficient Selection of Design Parameters in Multi-Objective Economic-Statistical Model of Attribute C Control Chart

Control chart is the most well-known chart to monitor the number of nonconformities per inspection unit where each sample consists of constant size. Generally, the design of a control chart requires determination of sample size, sampling interval, and control limits width. Optimally selecting these parameters depends on several process parameters, which have been considered from statistical and...

متن کامل

Comparison of Single and Multi-Step Bayesian Methods for Predicting Genomic Breeding Values in Genotyped and Non-Genotyped Animals- A Simulation Study

     The purpose of this study was to compare the accuracy of genomic evaluation for Bayes A, Bayes B, Bayes C and Bayes L multi-step methods and SSBR-C and SSBR-A single-step methods in the different values of π for predicting genomic breeding values of the genotyped and non-genotyped animals. A genome with 40000 SNPs on the 20 chromosom was simulated with the same distance (100cM). The π valu...

متن کامل

Minimizing the total tardiness and makespan in an open shop scheduling problem with sequence-dependent setup times

We consider an open shop scheduling problem with setup and processing times separately such that not only the setup times are dependent on the machines, but also they are dependent on the sequence of jobs that should be processed on a machine. A novel bi-objective mathematical programming is designed in order to minimize the total tardiness and the makespan. Among several mult...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

عنوان ژورنال:
  • Sci. Comput. Program.

دوره 75  شماره 

صفحات  -

تاریخ انتشار 2010